import basic from './basic.js';
var actmodel = new basic();
actmodel.tabprooffset = function (that, reset, para, xcsorts) { 
  if(!xcsorts)
  {
    xcsorts=[["id", "desc"], ["createtime", "desc"]] ;
  }
 
  var acturlpara = {};   
  acturlpara["url"] = "entry/wxapp/diy_index"
  para["plugin"] = "diy"
  
  if (para) {
    para["op"] = "tabprooffset"
  }
  else {
    this.wherepara["op"] = "tabprooffset"
  }


  if(para["num"]){
 this.syspage["limit"]=para["num"]




  }
  return actmodel.pagelist(acturlpara, that, reset, para, xcsorts);
}

actmodel.diydata = function (id) {
  var app = getApp();
  return new Promise((resolve, reject) => {
    app.util.request({
      'url': 'entry/wxapp/diy_index',
      showLoading: false,
      // 'data': { "op": "index",id:id,plugin:'diy' },
      'data': { "op": "index",id:id,plugin:'diy' },
      'method': "post",
      success: function (res) {
        var reslutmodel = res.data.data;
        resolve(reslutmodel);
      },
      fail: function (res) {
        resolve({ status: -1, "message": "操作失败2" });
      },
      complete: function () {
      }
    },true);
  })
} 
module.exports = actmodel;
